package com.example.springbootelasticsearch.controller;

import com.example.springbootelasticsearch.model.EsSight;
import com.example.springbootelasticsearch.model.SearchParam;
import com.example.springbootelasticsearch.service.SightService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 搜索
 * @Author zhangdongkang
 * @Date 2022/1/21
 */
@RestController
public class SightController {

	@Autowired
	private SightService sightService;

	/**
	 * @Description 搜索
	 * @Author zhangdongkang
	 * @Date 2022/2/7
	 */
	@PostMapping("search")
	public Page<EsSight> search(@RequestBody SearchParam searchParam) {
		return sightService.search(searchParam);
	}



}
